package com.hackintosh.singleton.pattern.hungry;

import javax.swing.*;

/**
 * @description：用饿汉式单例模式模拟产生猪八戒对象
 * @author：twislyn
 * @date：Created in 2021/05/04
 * @modified By：
 * @version: 1.0
 */
public class Bajie extends JPanel {
    private static final Bajie instance = new Bajie();

    private Bajie(){
        JLabel label = new JLabel(new ImageIcon(this.getClass().getClassLoader().getResource("Bajie.jpg")));
        this.add(label);
    }

    public static Bajie getInstance(){
        return instance;
    }
}
